package entities.assertion;


public abstract class Assertion {

	// public abstract Assertion getPrimeCopy();
	public abstract String toSerializedString();

	public ConceptAssertion asConceptAssertion() {
		return (ConceptAssertion) this;
	}

	public RoleAssertion asRoleAssertion() {
		return (RoleAssertion) this;
	}

	public Assertion getPrimeCopy() {
		if (this instanceof ConceptAssertion) {
			// TODO: hack! these shouldn't be null
			if (this.asConceptAssertion().getIndividual() != null
					&& this.asConceptAssertion().getConcept() != null) {
				return new ConceptAssertion(this.asConceptAssertion()
						.getIndividual().getPrimeCopy(), this
						.asConceptAssertion().getConcept().getPrimeCopy());
			}
		} else if (this instanceof RoleAssertion) {
			return new RoleAssertion(this.asRoleAssertion()
					.getFirstIndividual().getPrimeCopy(), this
					.asRoleAssertion().getSecondIndividual().getPrimeCopy(),
					this.asRoleAssertion().getRole().getPrimeCopy());
		}
		// throw new Exception("Attempt to 'prime' Unrecognized Axiom Type.");
		return null;
	}
}
